package com.ymkyve.complex.james;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;



/**
 * 类HelloJMail.java的实现描述：TODO 类实现描述
 * 
 * @author paul.gaol
 * @date 2012-7-16
 */
public class HelloJMail {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-service.xml");
        JavaMailSender mailSender= (JavaMailSender) context.getBean("mailSender");
        SimpleMailMessage mail = new SimpleMailMessage();
        mail.setFrom("w5huozhe@163.com");
        mail.setTo("ymkyve501@163.com");
        mail.setSubject("测试spring Mail");
        mail.setText("hello,java");
        mailSender.send(mail);
    }
}
